package com.lyz.dataStructure.algorithm.wangyi2020;/**
 * @Author:759057893@qq.com Lyz
 * @Date: ${Date} 14:54
 * @Description:
 **/



import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 *@Author:759057893@qq.com Lyz
 *@Date: 2019/8/3 14:54
 *@Description:
 **/
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();

        List<String> list = new ArrayList<>();
        String s = "";
        int a =0,b=0,c=0;
        for(int i =0;i<t;i++){
            int n = sc.nextInt();
            int[] nums  = new int[n];
            for(int j =0;j<nums.length;j++){
                nums[j] = sc.nextInt();
            }
            for(int z =0;z<nums.length;z++){
                if(z==0){
                    if(nums[z]<nums[z+1]+nums[nums.length-1]){
                        a=a+1;
                    }else {
                        a = a-a;
                    }
                }
                if (z>0&&z<nums.length-1){
                    if(nums[z] <(nums[z-1]+nums[z+1])){
                        b++;
                    }else {
                        b =b -1 ;
                    }
                }
                if(z==nums.length-1){
                    if(nums[nums.length-1] <(nums.length-2+nums[0])){
                        c = c +1;
                    }else {
                        c = c-c ;
                    }
                }
            }
            if(a*b*c >0){
               s = "YES";
            }else{
                s = "NO";
            }
            list.add(s);
        }
        for(int i =0;i<list.size();i++){
            System.out.println( list.get(i));
        }
    }
}

